include $(ERP_BASE_PATH)/comm/makefile.comm.v2

INSTALL_PATH = /usr/local/c2csvc/update
LIB_EXPORT_PATH = $(ERP_BASE_PATH)/comm/export_lib_suse64 
INCLUDE = -I../include \
          -I../XXO \
          -I./ \
          -I../src \
          -I$(ERP_BASE_PATH)/gis/app/ \
          -I$(ERP_BASE_PATH)/gis/app/gismapgatewayao/XXO/ \
          -I$(ERP_BASE_PATH)/gis/app/giserpdao/XXO/ \
	  -I$(ERP_BASE_PATH)/comm/export_include/ \
          -I$(ERP_BASE_PATH)/comm/export_include/c2cplatform \
          -I$(ERP_BASE_PATH)/comm/export_include/app_platform \
          -I$(ERP_BASE_PATH)/comm/export_include/tlib \
          -I$(ERP_BASE_PATH)/comm/export_include/libc2c \
          -I$(ERP_BASE_PATH)/gis/export_include/ \
		  


LIB = -L$(ERP_BASE_PATH)/comm/$(LIB_PATH) -L$(ERP_BASE_PATH)/gis/export_lib_suse64 \
      $(LOG2_LIB) $(TMEM_LIB) \
      $(CFGCENTER_SET_LIB) \
      $(ITIL_LIB) \
      $(UTIL_LIB)


OUTPUT = ao_gis_core.so

VPATH = ../lib

SOURCES = giscoreao.cpp \
		giscoreao_adaptor.cpp \
		giscoreao_asynprotocol.cpp \
		giscoreao_dispatcher.cpp \
		geo_helper.cpp

		
OBJECTS=$(SOURCES:.cpp=.o)

CPPFLAGS += -D__PTH_UCTX_SWITCH__

all:$(OUTPUT) 

.SUFFIXES: .o .cpp
.cpp.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -c $(filter %.cpp, $^) 

.o:
	$(CXX) $(CPPFLAGS) $(INCLUDE) -o $@ $^ 

$(OUTPUT): $(OBJECTS)
	$(CXX) $(CFLAGS) -fPIC -shared -o $@ $^ $(LIB)

clean:
	rm -f *.o *.so *.~ *.bak

install:
	cp -f $(OUTPUT) $(INSTALL_PATH)

installrpm:
	sudo cp -vf $(OUTPUT) /data/rpm_data_64bit/icson/icson_ao_gis_core_1/build_directory/usr/local/c2csvc/so/
	
dep:
	mkdep -p$(VPATH) $(INCLUDE) $(SOURCES) > .depend

ifneq ($(wildcard .depend),)
include .depend
endif
